#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"
#include "unitTest1.h"


int unitTest1() {
    
    int seed = 1000;
    int numPlayer = 2;
    
	struct gameState G;
	int k[10] = {adventurer, gardens, embargo, village, minion, mine, cutpurse, 
		   sea_hag, tribute, smithy};
	
	printf("=========================\n TESTING SCOREFOR() FUNCTION \n=========================\n");
	
	initializeGame(numPlayer, k, seed, &G);
				
	if(scoreFor(0, &G)==3){
  		printf("TEST PASSED: Score for player 0 is %d after game initialized\n", scoreFor(0, &G));
	} else {
		printf("TEST FAILED: Score for player 0 is %d after game initialized\n", scoreFor(0, &G));
	}
		
	if(scoreFor(1, &G)==3){
  		printf("TEST PASSED: Score for player 1 is %d after game initialized\n", scoreFor(1, &G));
	} else {
		printf("TEST FAILED: Score for player 1 is %d after game initialized\n", scoreFor(1, &G));
	}

	int scoreBefore = scoreFor(0, &G);
	
	//Testing a curse card should remove 1 from the player's hand
	gainCard(0, &G, 0, 0);	
	
	if(scoreFor(0, &G)== scoreBefore - 1){
  		printf("TEST PASSED: With a curse card, player 0's score is %d \n", scoreFor(0, &G));
	} else {
		printf("TEST FAILED: With a curse card, player 0's score is %d\n", scoreFor(0, &G));
	}
	

    return 0;
}



